﻿Imports System.Data
Imports System.Data.OleDb
Imports DAO
Imports DTO

Public Class LichGanBus     Shared dao As New LichGanDao
    Public Shared Function LayDanhSachLichGan() As DataTable
        Return dao.LayDanhSachLichGan()
    End Function

    Public Shared Function TimLichGan(ByVal maTuyen As Long, ByVal ngayKhoiHanh As Date, ByVal thoiDiemKhoiHanh As String, ByVal maXe As Long) As DataTable
        Return dao.TimLichGan(maTuyen, ngayKhoiHanh, thoiDiemKhoiHanh, maXe)
    End Function

    Public Shared Function TimLichGanTheoMa(ByVal maCanTim As Integer) As DataTable
        Return dao.TimLichGanTheoMa(maCanTim)
    End Function

    Public Shared Function ThemMotLichGan(ByVal lg As LichGanDto) As Integer
        Return dao.ThemMotLichGan(lg)
    End Function

    Public Shared Function ThemLichGan(ByVal lg As LichGanDto) As Integer
        Return dao.ThemMotLichGan(lg)

    End Function

    Public Shared Function CapNhatLichGan(ByVal lg As LichGanDto) As Integer
        Return dao.CapNhatLichGan(lg)
    End Function

    Public Shared Function XoaMotLichGan(ByVal maCanXoa As Long) As Integer
        Return dao.XoaMotLichGan(maCanXoa)
    End Function

    'Tìm ngày khởi hành
    Public Shared Function TimNgayKhoiHanh(ByVal maTuyen As Integer) As DataTable
        Return dao.TimNgayKhoiHanh(maTuyen)
    End Function


    'Tìm giờ khởi hành
    Public Shared Function TimThoiDiemKhoiHanh(ByVal maTuyen As Integer, ByVal ngayKhoiHanh As Date) As DataTable
        Return dao.TimThoiDiemKhoiHanh(maTuyen, ngayKhoiHanh)
    End Function

    'Lấy danh sách xe đang
    Public Shared Function DanhSachXeDangRanh(ByVal ngayKhoiHanh As Date, ByVal ThoiDiemKhoiHanh As String) As DataTable
        Return dao.DanhSachXeDangRanh(ngayKhoiHanh, ThoiDiemKhoiHanh)
    End Function

    'Lấy mã lịch gán vừa thêm vào
    Public Shared Function LayMaLichGanVuaThem() As Long
        Return dao.LayMaLichGanVuaThem()
    End Function
    'Bán vé...

    'Tìm xe theo tuyến, thời điểm
    Public Shared Function DanhSachXe_TheoTuyen_ThoiDiem(ByVal maTuyen As Long, ByVal ngayKhoiHanh As Date, ByVal ThoiDiemKhoiHanh As String) As DataTable
        Return dao.DanhSachXe_TheoTuyen_ThoiDiem(maTuyen, ngayKhoiHanh, ThoiDiemKhoiHanh)
    End Function

End Class
